package com.example.imoocmall.model.request;

import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
public class AddProductReq {

    @NotNull(message = "商品名称不能为空")
    private String name;//商品名称
    @NotNull(message = "商品图片不能为空")
    private String image;//商品图片,相对路径地址

    @NotNull(message = "商品详情不能为空")
    private String detail;//商品详情

    @NotNull(message = "商品分类不能为空")
    private Integer categoryId;//分类id

    @NotNull(message = "商品价格不能为空")
    @Min(value = 1,message = "商品价格不能小于1")
    private Integer price;//商品价格单位是分

    @NotNull(message = "商品库存不能为空")
    @Max(value = 10000,message = "商品库存不能大于10000")
    private Integer stock;//库存数量

    private Integer status;//商品上架状态0下架1上架


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image == null ? null : image.trim();
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail == null ? null : detail.trim();
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

}